{% extends 'layout.html' %}
{% load static %}
{#引入日期插件的css#}
{% block css %}
    <link rel="stylesheet" href="{% static 'plugins/bootstrap-datepicker-1.9.0/bootstrap-datepicker.min.css' %}">
{% endblock %}
{% block content %}
    <div class="container">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">新建员工（原始方式编写代码）</h3>
            </div>
            <div class="panel-body">
                <form method="post">
                    {% csrf_token %}
                    <div class="form-group">
                        <label>姓名</label>
                        <input name="name" type="text" class="form-control" placeholder="姓名">

                    </div>
                    <div class="form-group">
                        <label>密码</label>
                        <input name="password" type="password" class="form-control" placeholder="密码">

                    </div>
                    <div class="form-group">
                        <label>性别</label>
                        <select class="form-control" name="gender">
                            {% for obj in gender %}
                                <option value="{{ obj.0 }}">{{ obj.1 }}</option>
                            {% endfor %}
                        </select>
                    </div>
                    <div class="form-group">
                        <label>年龄</label>
                        <input name="age" type="text" class="form-control" placeholder="年龄">

                    </div>
                    <div class="form-group">
                        <label>帐户余额</label>
                        <input name="account" type="text" class="form-control" placeholder="帐户余额">

                    </div>
                    <div class="form-group">
                        <label>入职时间</label>
                        <input id="id_create_time" name="create_time" type="date" class="form-control" placeholder="入职时间">

                    </div>
                    <div class="form-group">
                        <label>所属部门</label>
                        <select class="form-control" name="depart">
                            {% for obj in depart %}
                                <option value="{{ obj.id }}">{{ obj.title }}</option>
                            {% endfor %}
                        </select>

                    </div>

                    <button type="submit" class="btn btn-primary">保存</button>
                </form>
            </div>
        </div>
    </div>
{% endblock %}

{% block js %}
    <script src="{% static 'plugins/bootstrap-datepicker-1.9.0/js/bootstrap-datepicker.min.js' %}"></script>
    <script src="{% static 'plugins/bootstrap-datepicker-1.9.0/locales/bootstrap-datepicker.zh-CN.min.js' %}"></script>
    <script>
        $(function () {
            $('#id_create_time').datepicker({
                format: 'yyyy-mm-dd',
                startDate: '0',
                language: 'zh-CN',
                autoclose: true,
            });
        })
    </script>
{% endblock %}
